import os
# ends = [r" 1 0 0 20 20", r" 1 0 0 80 80"]
ends = [r" 1 0 0 20 20"]
# paths = ['./have_mask.txt', './no_mask.txt']
paths = ['./have_mask.txt']
buff = ''
for i in range(2):
    filelist = open(paths[i], 'r+', encoding = 'utf-8')
    filetmp = open(paths[i] + '.tmp', 'w', encoding='utf-8')
    line = filelist.readlines()
    for file in line:
        file = file.strip('\n') + ends[i] + '\n'
        filetmp.write(file)
    filelist.close()
    filetmp.close()
    filelist = open(paths[i], 'w', encoding = 'utf-8')
    filetmp = open(paths[i] + '.tmp', 'r', encoding='utf-8')
    line = filetmp.readlines()
    for file in line:
        file = file.strip('\n') + '\n'
        print(file)
        filelist.write(file)
    filelist.close()
    filetmp.close()
    os.remove(paths[i] + '.tmp')
    